package com.example.demo.shengchan;

import com.alibaba.fastjson.JSON;
import com.example.demo.model.User;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Date;

@Component
public class HelloSender1 {

    @Resource
  private RabbitTemplate amqpTemplate;

    public void send(String s) {
        amqpTemplate.convertAndSend("temp", s);
    }


    public void receive() {
        amqpTemplate.receiveAndConvert("temp");
    }
}
